package example.factory.simple;


import example.factory.Audi;
import example.factory.Benz;
import example.factory.Bmw;
import example.factory.Car;

public class SimpleFactory {

    public Car getCar(String type) {
        if ("bmw".equalsIgnoreCase(type)) {
            return new Bmw();
        } else if ("benz".equalsIgnoreCase(type)) {
            return new Benz();
        } else if ("audi".equalsIgnoreCase(type)) {
            return new Audi();
        } else {
            return null;
        }
    }
}
